<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>分类</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style>
        body {
            background-color: #fff;
        }
        .guess_love {
            width: 100%;
            overflow: hidden;
            padding: 0 15px;
            margin-top: 16.5px;
            box-sizing: border-box;
        }

        .guess_love>.title {
            width: 100%;
            overflow: hidden;
            display: flex;
            padding: 0 110px;
            box-sizing: border-box;
            justify-content: space-between;
        }

        .guess_love .title div.line {
            width: 17px;
            height: 1px;
            background: #FF4141;
            margin-top: 7px;
        }

        .guess_love .title div.text {
            height: 15;
            line-height: 15px;
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            flex: 1;
            text-align: center;
        }

        .guess_love ul {
            width: 100%;
            overflow: hidden;
        }

        .guess_love ul li {
            width: 100%;
            overflow: hidden;
            display: flex;
            padding: 10px 0;
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0, #EEEEEE, #EEEEEE 50%, transparent 50%);
            background-image: -webkit-linear-gradient(90deg, #EEEEEE, #EEEEEE 50%, transparent 50%);
        }

        .guess_love ul li div.shop_picture {
            width: 100px;
            height: 100px;
            /*width: 100%;*/
            border-radius: 5px;
        }

        .guess_love ul li div.shop_picture img {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 5px;
        }

        .guess_love ul li div.shop_info {
            flex: 1;
            min-width: 0;
            margin-left:6px;
            box-sizing: border-box;
        }

        .guess_love ul li div.shop_info div.title {
            display: flex;
        }

        .guess_love ul li div.shop_info div.title span:first-child {
            width: 25px;
            height: 12px;
            margin-top: 0.5px;
            margin-right: 4px;
        }

        .guess_love ul li div.shop_info div.title span:first-child img {
            display: block;
            width: 100%;
            height: 100%;
        }

        .guess_love ul li div.shop_info div.title span:last-child {
            width: auto;
            max-width: 202px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            height: 13px;
            line-height: 13px;
            font-size: 14px;
            /*font-weight: bolder;*/
        }

        .guess_love ul li div.shop_info div.price {
            display: flex;
            margin-top: 18px;
        }

        .guess_love ul li div.shop_info div.price span {
            height: 13px;
            line-height: 13px;
            font-size: 12px;
        }

        .guess_love ul li div.shop_info div.price span:last-child {
            color: #FF4141;
            font-size: 17px;
        }

        .guess_love ul li div.shop_info div.price span:first-child {
            color: #999999;
            font-size: 10px;
            line-height: 14px;
            /*font-weight: bolder;*/
        }

        .guess_love ul li div.shop_info div.price span:nth-child(2) {
            color: #666666;
            font-size: 10px;
            line-height: 14px;
        }

        .guess_love ul li div.shop_info div.coupons {
            display: flex;
            margin-top: 3px;
        }

        .guess_love ul li div.shop_info div.coupons span:first-child {
            width: 50px;
            height: 15px;
            /*background: #FFE3E3;*/
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            text-align: center;
            line-height: 15px;
            background: url(../../image/arebuyingcoupon_bg.png) no-repeat;
            background-size:100% 100%;
        }

        /*.guess_love ul li div.shop_info div.coupons span:last-child {
            width: 50px;
            height: 15px;
            background: linear-gradient(-90deg, #7519EB, #A329F3);
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #fff;
            text-align: center;
            line-height: 15px;
            margin-left: 4px;
        }*/

        .guess_love ul li div.shop_info div.sold {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #999999;
            /*text-align: center;*/
            line-height: 12px;
            margin-top: 6px;
        }

        .guess_love ul li div.shop_info div.name {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #999999;
            /*text-align: center;*/
            line-height: 10px;
            margin-top: 6px;
        }
        /*数据列表css*/

        .datalist {
            width: 100%;
            padding: 0 15px;
            box-sizing: border-box;
            overflow: hidden;
        }

        .datalist .sort {
            width: 100%;
            height: 50px;
            padding-left: 20px;
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
            position: fixed;
            background-color: #fff;
        }

        .datalist .sort .sort_select {
            flex: 1;
            line-height: 50px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #333333;
            display: flex;
        }

        .datalist .sort .sort_select span.selected {
            width: 18px;
            height: 18px;
            margin-top: 16px;
        }

        .aui-radio,
        .aui-checkbox {
            width: 18px;
            height: 18px;
            /*background-color: #ffffff;*/
            border: solid 1px #dddddd;
            -webkit-border-radius: 0.6rem;
            border-radius: 0.6rem;
            /*font-size: 0.8rem;*/
            margin: 0;
            padding: 0;
            position: relative;
            display: inline-block;
            vertical-align: top;
            cursor: default;
            -webkit-appearance: none;
            -webkit-user-select: none;
            user-select: none;
            -webkit-transition: background-color ease 0.1s;
            transition: background-color ease 0.1s;
        }

        .aui-radio:checked,
        .aui-radio.aui-checked,
        .aui-checkbox:checked,
        .aui-checkbox.aui-checked {
            background: url(../../image/select.png) no-repeat;
            background-size: 18px 18px;
            border: none;
            /*background-color: #49A76D;
          border: solid 1px #49A76D;
          text-align: center;
          background-clip: padding-box;
          background: -moz-linear-gradient(top, #49A76D 0%, #97E3B4 100%);*/
            /*background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #000000), color-stop(100%, #ffffff));
          background: -webkit-linear-gradient(top, #000000 0%, #ffffff 100%);
          background: -o-linear-gradient(top, #000000 0%, #ffffff 100%);
          background: -ms-linear-gradient(top, #000000 0%, #ffffff 100%);
          background: linear-gradient(to bottom, #000000 0%, #ffffff 100%);
          filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff', GradientType=0);*/
        }

        .aui-radio:checked:before,
        .aui-radio.aui-checked:before,
        .aui-checkbox:checked:before,
        .aui-checkbox.aui-checked:before,
        .aui-radio:checked:after,
        .aui-radio.aui-checked:after,
        .aui-checkbox:checked:after,
        .aui-checkbox.aui-checked:after {
            content: '';
            width: 0rem!important;
            height: 0rem!important;
            position: absolute;
            top: 0!important;
            left: 0!important;
            margin-left: 0rem!important;
            margin-top: 0rem!important;
            background: transparent;
            border: 0px solid #ffffff !important;
            border-top: none;
            border-right: none;
            z-index: 2;
            -webkit-border-radius: 0;
            border-radius: 0;
            -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }

        .datalist .sort .sort_select span:last-child {
            margin-left: 5px;
        }

        .datalist .sort .sort_select span.icon {
            width: 6.5px;
            height: 10px;
            margin-top: 20px;
        }

        .datalist .sort .sort_select span.icon img {
            width: 100%;
            height: 100%;
            display: block;
        }

        .banner {
            width: 100%;
            height: 80px;
            margin-top: 50px;
        }

        .banner img {
            display: block;
            width: 100%;
            height: 100%;
        }

        .active {
            color: #FF4141!important;
        }

        [v-cloak] {
            display: none!important;
        }
    </style>
</head>

<body>
    <div id="app">
      <div class="wrap">
          <div class="guess_love">
              <ul>
                  <!-- <li>
                      <div class="shop_picture">
                          <img src="" alt="">
                      </div>
                      <div class="shop_info">
                          <div class="title"><span><img src="../../image/tm.png" alt=""></span><span>舌里蛋黄酥雪媚娘12枚面包整箱休箱...</span></div>
                          <div class="price"><span>券后</span><span>￥</span><span>20</span></div>
                          <div class="coupons"><span>5元券</span><span>返1.98元</span></div>
                          <div class="sold">已售1.86万</div>
                          <div class="name">百草味旗舰店 进店></div>
                      </div>
                  </li> -->
                  <li v-for='item in dataList' @click='openGoodsDtailsPage(item.goodsId)'>
                      <div class="shop_picture">
                          <img :src="item.mainPic" alt="">
                      </div>
                      <div class="shop_info">
                          <div class="title">
                              <span v-if='item.shopType==1'><img src="../../image/tm.png" alt=""></span>
                              <span v-else><img src="../../image/tb_search.png" alt=""></span>
                              <span>{{item.title}}</span>
                          </div>
                          <div class="price">
                            <span>券后</span>
                            <span style="color:#FF4141;">￥</span>
                            <span>{{item.actualPrice}}</span></div>
                          <div class="coupons">
                              <span>{{item.couponPrice}}元券</span>
                              <!-- <span>返1.98元</span> -->
                          </div>
                          <div class="sold">已售{{item.monthSales}}</div>
                          <div class="name">{{item.shopName}} 进店></div>
                      </div>
                  </li>

              </ul>
          </div>
      </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {
        vm.initList(api.pageParam.cid);
        vm.bottomLoad();
        vm.initRefresh();
        api.addEventListener({
            name: 'queryClassify'
        }, function(ret, err){
            if( ret ){
                 vm.dataList = [];
                 vm.sort=ret.value.value;
                 vm.initList(api.pageParam.cid);
            }
        });

    };
    var vm = new Vue({
        el: "#app",
        data: {
          pageId:1,
          sort:0, //排序
          dataList:[],
        },
        methods: {
          initList:function(subcid,isClick){
            console.log(subcid);
            if (isClick) {
                vm.pageId += 1;
            } else { // 下拉刷新 或者 初次加载
                vm.pageId = 0;
            }
            cl.openLoading();
            api.ajax({
                url: cl.apiServer + 'tb/getGoodsList',
                method: 'post',
                headers: {
                    'Content-Type': 'application/json;charset=utf-8',
                    token:cl.userToken
                },
                data: {
                    body: {
                        cids:'',
                        pageId:vm.pageId,
                        pageSize:10,
                        sort:vm.sort,
                        subcid:subcid,
                        version:cl.deviceInfo().appVersion,
                        mobileInfo:cl.systemType()
                    }
                }
            }, function(ret, err) {
                console.log(JSON.stringify(ret))
                if (ret) {
                    if (ret.code == 0) {
                      cl.closeLoading();
                      if (ret.data.totalNum > 0) {
                          if (ret.data.goodsList.length >= 10) {
                              vm.no_more = false;
                          } else if (ret.data.goodsList.length == 0) {
                              vm.no_more = true;
                          }
                          vm.dataList = vm.dataList.concat(ret.data.goodsList);
                      } else {
                          // vm.isEnptyDataFigure = true;
                          // vm.no_more = false;
                          vm.dataList = [];
                      }
                    }
                }
            });
          },
          //上拉加载
          bottomLoad: function() {
              cl.scrollBottom(function() {
                vm.initList(true)
              })
          },
          //下拉刷新
          initRefresh: function() {
              cl.openRefresh(function() {
                  vm.initList()
              })
          },
          openGoodsDtailsPage: function(id) {
              cl.openWin({
                  name: 'goods_deatils',
                  pageParam: {
                      id: id
                  }
              })
          }
        }
    })
</script>

</html>
